package com.csproj.system.service.dto;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * A DTO for the AuthorityInfo entity.
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class AuthorityInfoDTO implements Serializable {

    private String id;

    private String code;

    private String parentCode;

    private String name;

    private String permission;

    private String target;

    private String icon;

    private Integer sort;


    private String remark;

    //子权限
    private List<AuthorityInfoDTO> authorityInfoList;

    public List<AuthorityInfoDTO> getAuthorityInfoList() {
        return authorityInfoList;
    }

    public AuthorityInfoDTO setAuthorityInfoList(List<AuthorityInfoDTO> authorityInfoList) {
        this.authorityInfoList = authorityInfoList;
        return this;
    }
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }
    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }
    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        AuthorityInfoDTO authorityInfoDTO = (AuthorityInfoDTO) o;

        if ( ! Objects.equals(id, authorityInfoDTO.id)) { return false; }

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "AuthorityInfoDTO{" +
            "id=" + id +
            ", code='" + code + "'" +
            ", parentCode='" + parentCode + "'" +
            ", name='" + name + "'" +
            ", permission='" + permission + "'" +
            ", target='" + target + "'" +
            ", icon='" + icon + "'" +
            ", sort='" + sort + "'" +
            '}';
    }
}
